/************************************************************************/
/* 
mpeg12 encopts setting for dvd vcd svcd
author pengl
date 2008-11-27
*/
/************************************************************************/


#include "StdAfx.h"
#include ".\mpeg12enc_opts.h"

static char gmpeg12enc_opts[1024] = {0};

Cmpeg12enc_opts::Cmpeg12enc_opts(void)
{
}

Cmpeg12enc_opts::~Cmpeg12enc_opts(void)
{
}



/************************************************************************/
/* 
PAL DVD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_PAL_DVD()
{
	sprintf(gmpeg12enc_opts, "%s", "-oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
								   -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \
								   -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
								   keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 ");
	return gmpeg12enc_opts;
}

/************************************************************************/
/* 
NTSC DVD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_NTSC_DVD()
{
	sprintf(gmpeg12enc_opts, "%s ", "mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
									-vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 \
									-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
									keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001");
	return gmpeg12enc_opts;
}

/************************************************************************/
/*
PAL AVI Containing AC-3 Audio to DVD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_palavi()
{
	sprintf(gmpeg12enc_opts, "%s ", "-oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
									-vf scale=720:576,harddup -ofps 25 \
									-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
									keyint=15:vstrict=0:aspect=16/9:acodec=ac3:abitrate=192");
	return gmpeg12enc_opts;
}

/************************************************************************/
/* 
NTSC AVI Containing AC-3 Audio to DVD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_ntscavi()
{
	sprintf(gmpeg12enc_opts, "%s ", "-oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf:telecine \
									-vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:\
									vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:aspect=16/9:acodec=ac3:abitrate=192 -ofps 24000/1001");
	return gmpeg12enc_opts;
}

/************************************************************************/
/* 
PAL SVCD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_palsvcd()
{
	sprintf(gmpeg12enc_opts, "%s ", "-oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \
									scale=480:576,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
									vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:\
									vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 25 ");
	return gmpeg12enc_opts;
}

/************************************************************************/
/* 
NTSC SVCD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_ntscsvcd()
{
	sprintf(gmpeg12enc_opts, "%s ", "-oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd  -vf \
									scale=480:480,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
									vcodec=mpeg2video:mbd=2:keyint=18:vrc_buf_size=917:vrc_minrate=600:\
									vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 30000/1001");
	return gmpeg12enc_opts;
}

/************************************************************************/
/* 
PAL VCD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_palvcd()
{
	sprintf(gmpeg12enc_opts, "%s ", "-oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
									scale=352:288,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
									vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:\
									vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 25");

	return gmpeg12enc_opts;
}

/************************************************************************/
/* 
NTSC VCD
*/
/************************************************************************/
char *Cmpeg12enc_opts::get_ntscvcd()
{
	sprintf(gmpeg12enc_opts, "%s ", "-oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
									scale=352:240,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
									vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:\
									vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 30000/1001");
	return gmpeg12enc_opts;
}


